package com.itheima.security.springmvc.init;

import com.itheima.security.springmvc.config.ApplicationConfig;
import com.itheima.security.springmvc.config.WebConfig;
import com.itheima.security.springmvc.config.WebSecurityConfig;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

/**
 * @author xiaoxiaokui
 * @description: SpringApplicationInitializer
 * @date 2019/11/15
 **/
public class SpringApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
    /**
     * @description spring容器，相当于加载 applicationContext.xml
     * @author xiaoxiaokui
     * @date 2019/11/15
     * @param
     * @return java.lang.Class<?>[]
     * @modifier
     * @note
     **/
    @Override
    protected Class<?>[] getRootConfigClasses() {
        return new Class[] {ApplicationConfig.class, WebSecurityConfig.class};
    }
    
    /**
     * @description ServletContext，相当于加载springmvc.xml
     * @author xiaoxiaokui 
     * @date 2019/11/15
     * @param
     * @return java.lang.Class<?>[]
     * @modifier
     * @note
     **/
    @Override
    protected Class<?>[] getServletConfigClasses() {
        return new Class[] {WebConfig.class};
    }
    
    /**
     * @description url-mapping
     * @author xiaoxiaokui 
     * @date 2019/11/15
     * @param
     * @return java.lang.String[]
     * @modifier
     * @note
     **/
    @Override
    protected String[] getServletMappings() {
        return new String[] {"/"};
    }
}
